#include<string>
using namespace std;
string opers="+-*/%";
enum{
    DivZero=1,
    ModZero,
    Unknown,
};
class Task
{
public:
    Task(int data1,int data2,char op)
        :data1_(data1),data2_(data2),oper_(op),result_(0),exitcode_(0)
    {}
    void run(){
        switch(oper_)
        {
            case '+':
                result_=data1_+data2_;
                break;
            case '-':
                result_=data1_-data2_;
                break;
            case '*':
                result_=data1_*data2_;
                break;
            case '/':{
                if(data2_==0) exitcode_=DivZero;
                else result_=data1_/data2_;
            }
            break;
            case '%':{
                if(data2_==0)exitcode_=ModZero;
                else result_=data1_/data2_;
            } 
            break;
            default:
                exitcode_=Unknown;
                break;
        }
    }
    void operator()()
    {
        run();
    }
    string getresult(){
        string ans;
        ans=to_string(data1_)+oper_+to_string(data2_)+"=";
        ans+=to_string(result_);
        ans+="[code:";
        ans+=to_string(exitcode_);
        ans+="]";
        return ans;
    }
    string getTask(){
        string n;
        n+=to_string(data1_);
        n+=oper_;
        n+=to_string(data2_);
        n+="=?";
        return n;
    }
    ~Task()
    {}
private:
    int data1_;
    int data2_;
    char oper_;

    int result_;
    int exitcode_;
};